import conf from '../../config';
import Http from '../http';

const apis = {
  login: '/auth/login',
  getInfo: '/system/user/getInfo',
  getRouters: '/system/menu/getRouters',
  getRouters: '/system/menu/getRouters',
}

const homeApis = Object.keys(apis).reduce((total, name) => {
  const baseUrl = `${conf.interface.baseUrl}/kpi-base-web/minstone`;
  const methods = (params, isJson) => Http.post(baseUrl + apis[name], params, isJson ? '' : wx.httpType);
  return { ...total, [name]: methods };
}, {});

export default homeApis;